package com.lamp.horizontal;

import com.lamp.main.R;
import com.lamp.main.R.color;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.util.AttributeSet;
import android.widget.LinearLayout;

public class HSLinearLayout extends LinearLayout {
	private Paint paint;

	public HSLinearLayout(Context context) {
		super(context);
		init();

	}

	public HSLinearLayout(Context context, AttributeSet attr) {
		super(context, attr);
		init();
	}

	private void init() {
		paint = new Paint();
		paint.setAntiAlias(true);
		paint.setStyle(Style.STROKE);
		paint.setStrokeWidth(2);
		paint.setColor(R.color.black);
	}

	@Override
	protected void dispatchDraw(Canvas canvas) {

		int w = this.getWidth();
		int h = this.getHeight();

		canvas.drawColor(Color.WHITE);
		canvas.drawCircle(w / 2, h / 2, (w / 3) * 2, paint);
		super.dispatchDraw(canvas);
	}

}
